package com.ymatou.iapi.godmch.service;

import org.json.JSONObject;

import com.ymatou.iapi.godmch.parameter.MerchantFundCollectConfigResp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*添加积分Call
*FreeMaker Template自动生成代码
*/
public class MerchantFundCollectConfigCall extends YmatouBaseCall{
	private static String opurl ="api/mch/merchantFundCollectConfig";
	
	public MerchantFundCollectConfigCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public MerchantFundCollectConfigResp getMerchantFundCollectConfigResp()
			throws Exception {
		
		Object result = new JSONObject(getReturnData()).get("result");
		
		if (result.toString().equalsIgnoreCase("null"))
			return null;
		else
			return (MerchantFundCollectConfigResp) FormatUtil.GSONToObject(
					new JSONObject(getReturnData()).getJSONObject("result")
							.toString(), MerchantFundCollectConfigResp.class);
	}
}